<!-- JavaScript -->
</div>

<script src="__STATIC__/js/jquery-1.10.2.js"></script>
<script src="__STATIC__/js/bootstrap.js"></script>
<script src="__STATIC__/js/app.js"></script>
<script src="__STATIC__/js/dialog-min.js"></script>
<script type="text/javascript">
    var currentTime = new Date().getTime();
    function require() {
        $.ajax({
            url: "{:U('Warn/checkWarn')}",
            type: 'POST',
            dataType: 'json',
            timeout: 80000,
            data: {
                time: currentTime
            },
            success: function (data) {

                if (data.status) {
                    showWarn(data.warn_obj, data.warn_type);
                }
            },
            error: function () {
            }
        });

        currentTime = new Date().getTime();
        setTimeout('require()', 3000);
    }


    function showWarn(id, type) {

        var d = dialog({
            title: '警告',
            content: '<html><body><p style="color:red">发现可疑人员信息(' + type + '),<br>请及时通知相关部门<p><audio autoplay="true" loop ="1" src="./Admin/View/warn.mp3"/></body></html>',
            okValue: '查看',
            ok: function () {
                window.location.href = "{:U('Index/info?key=')}" + id;
                return false;
            },
            cancelValue: '取消',
            cancel: function () {
            }
        });
        $isShow = true;
        d.show();
//        setTimeout(function () {
//            d.close();
//        }, 3000)
    }
    window.onload = require;
</script>
</body>
</html>